<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/8/24
 * Time: 16:06
 */
class Base extends MY_Api_Controller
{
    /**
     * 获取列表
     */
    public function lists()
    {
        $cid   = (int)$this->input->get_post('cid');
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('article/service_article_base');
        $data = $this->service_article_base->lists($cid, $page, $limit);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 获取一条文章
     */
    public function item()
    {
        $aid = intval($this->input->get_post('aid'));

        $this->load->service('article/service_article_base');
        $data = $this->service_article_base->item($aid);


        $this->json_output($data['data'], $data['status']);
    }
}